package com.yunhai.system.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.yunhai.system.mapper.EnvironmentalMapper;
import com.yunhai.system.domain.Environmental;
import com.yunhai.system.service.IEnvironmentalService;

import java.util.List;
import java.util.Map;

/**
 * 环境公示Service业务层处理
 *
 * @author ruoyi
 * @date 2021-01-20
 */
@Service
public class EnvironmentalServiceImpl extends ServiceImpl<EnvironmentalMapper, Environmental> implements IEnvironmentalService {

    @Override
    public List<Environmental> queryList(Environmental environmental) {
        LambdaQueryWrapper<Environmental> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(environmental.getTitle())) {
            lqw.eq(Environmental::getTitle, environmental.getTitle());
        }
        lqw.orderByDesc(Environmental::getCreateTime);
        return this.list(lqw);
    }
}
